package abcy.cloud.blogcommon.utils;

import abcy.cloud.blogcommon.enums.SignEnum;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.UUID;

@Component
public class UUIDUtil {

    public static String UUID(){
        return UUID.randomUUID().toString().replaceAll("-","");
    }

    public static void main(String[] args) {
        CodeUtil.codeGenerator(SignEnum.USER.getValue(), "_0000000001");
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String d = sdf.format(new Date());
        LocalDateTime l = LocalDateTime.parse(d,df);
        System.out.println(l);
    }
}
